<?php

$sql = 'SELECT accessLevel FROM `users` WHERE `userId`='.$_GET['userId']. ' ORDER BY accessLevel';
			  $result = $dbRead->fetchAll($sql,$_GET['userId']);
  
			   $admin = 10;
			   $user = 20;
			   $ruser = 30;
    echo "<option"; 
    if($result[0]['accessLevel']==$admin){echo " selected=selected";} 
    echo ' value='. $admin . ">Administrator</option>";
	
    echo "<option"; 
    if($result[0]['accessLevel']==$user){echo " selected=selected";} 
	echo ' value='. $user . ">User</option>";
	 
    echo "<option"; 
    if($result[0]['accessLevel']==$ruser){echo " selected=selected";} 
echo ' value='. $ruser . ">Restricted User</option>"; 


/*
if (isset($result['accessLevel'])){
	echo '<option value="10"'.(($result['accessLevel']===10) ? 'selected="selected"' : "").'>Administrator</option>';
	echo '<option value="20"'.(($result['accessLevel']===20) ? 'selected="selected"' : "").'>User</option>';
	echo '<option value="30"'.(($result['accessLevel']===30) ? 'selected="selected"' : "").'>Restricted User</option>';

	
}else{
	if (isset($_POST['accessLevel'])){
		echo '<option value="10"'.(($_POST['accessLevel']===10) ? 'selected="selected"' : "").'>Administrator</option>';
		echo '<option value="20"'.(($_POST['accessLevel']===20) ? 'selected="selected"' : "").'>User</option>';
	    echo '<option value="30"'.(($_POST['accessLevel']===30) ? 'selected="selected"' : "").'>Restricted User</option>';				
	
}else {
	echo '<option value="10" selected="selected" >Administrator</option>';
    echo '<option value="20">User</option>';
    echo '<option value="30">Restricted User</option>';

}}

*/
?>